package com.mayinghao.httpurl;


import java.sql.ResultSet;
import java.sql.SQLException;
import com.zsoft.webmail.http.HttpUtils;
import control.database.DataBase;

public class PerformLogin {
	public String kaiTong(String username,String pwd,String grade) throws Exception {
		
		String url = "http://www.m10060.com/webmailln/ext_jzst_pausename.jsp?username="+username+"&hostname=10060.com";
		System.out.println(url);
		java.net.HttpURLConnection huc = HttpUtils.getConnection(url, null);
		HttpUtils.sendRequest(huc, null);
		String src = HttpUtils.getResponse(huc);
		return src;
	}
	public static void main(String[] args) throws SQLException {
		String temp="";
		DataBase db2=new DataBase();
	    ResultSet rs2=null;
	  String sql="select * from users_20060903 where domainName='10060.com' and state=0 ";
	  
	    rs2=db2.executeQuery(sql);
	    String str="";
	    try {
			while(rs2.next())
			{
				
			try {
				str=new PerformLogin().kaiTong(rs2.getString("username"),rs2.getString("pwd"),rs2.getString("grade"));
			    System.out.println(" "+str);
			} catch (Exception e) {
				
				e.printStackTrace();
			}
          
			}

			
		} catch (SQLException e) {

			e.printStackTrace();
		}
		rs2.close();
        db2.closeStmt();
        db2.closeConn();
	}
}
